package com.longzz.web;

import com.longzz.service.DanmuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by longzzz on 2018/6/27.
 */
@RestController
@RequestMapping("/api/v1/danmu")
public class DanmuController {

    @Autowired
    private DanmuService danmuService;

    @RequestMapping(value = "/download",method = RequestMethod.GET)
    public void danmuDownload(@RequestParam("url") String url, HttpServletResponse response) throws Exception {
        danmuService.export(url,response);
    }

}
